// 蜂窝蜜造平台生成代码，如手工更改，请添加到 .beeignore 忽略生成

package com.fowo.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fowo.api.common.model.OptionItem;
import com.fowo.api.entity.SalesWithdraw;
import com.fowo.api.model.sales.withdraw.SalesWithdrawItemVo;
import com.fowo.api.model.sales.withdraw.SalesWithdrawSearchParamPo;
import com.fowo.api.model.sales.withdraw.SalesWithdrawVo;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SalesWithdrawMapper extends BaseMapper<SalesWithdraw> {
  Page<SalesWithdrawItemVo> pageSearch(
    @Param("page") Page page,
    @Param("search") SalesWithdrawSearchParamPo search
  );
  List<OptionItem<SalesWithdrawItemVo>> searchOptions(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  List<SalesWithdrawItemVo> search(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  Date searchLastUpdateTime(@Param("search") SalesWithdrawSearchParamPo search);
  /**
   * 搜索满足条件的所有记录的编号列表
   * @param search 搜索参数
   * @return 编号列表
   */
  List<Long> searchIds(@Param("search") SalesWithdrawSearchParamPo search);
  /**
   * 搜索满足条件的记录数量
   * @param search 搜索参数
   * @return 记录数量
   */
  Long searchCount(@Param("search") SalesWithdrawSearchParamPo search);
  Long getIdByGlobalOrderNo(@Param("globalOrderNo") String globalOrderNo);

  List<Long> getIdsByGlobalOrderNo(@Param("list") List<String> list);

  String getGlobalOrderNoById(@Param("id") Long id);

  List<Map<String, Object>> getGlobalOrderNoByIds(@Param("ids") List<Long> ids);
  SalesWithdrawVo selectVoById(@Param("id") Long id);
  /**
   * 全部
   */
  List<SalesWithdrawItemVo> allOrders(
    @Param("search") SalesWithdrawSearchParamPo search
  );

  /**
   * 获取全部编号列表
   */
  List<Long> allOrdersIds(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 获取全部的总数
   */
  Long allOrdersCount(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 全部分页
   */
  Page<SalesWithdrawItemVo> allOrdersPage(
    @Param("page") Page page,
    @Param("search") SalesWithdrawSearchParamPo search
  );
  Date allOrdersLastUpdateTime(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  /**
   * 待收货
   */
  List<SalesWithdrawItemVo> waitReceived(
    @Param("search") SalesWithdrawSearchParamPo search
  );

  /**
   * 获取待收货编号列表
   */
  List<Long> waitReceivedIds(
    @Param("search") SalesWithdrawSearchParamPo search
  );

  /**
   * 获取待收货的总数
   */
  Long waitReceivedCount(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 待收货分页
   */
  Page<SalesWithdrawItemVo> waitReceivedPage(
    @Param("page") Page page,
    @Param("search") SalesWithdrawSearchParamPo search
  );
  Date waitReceivedLastUpdateTime(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  /**
   * 已完成
   */
  List<SalesWithdrawItemVo> completed(
    @Param("search") SalesWithdrawSearchParamPo search
  );

  /**
   * 获取已完成编号列表
   */
  List<Long> completedIds(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 获取已完成的总数
   */
  Long completedCount(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 已完成分页
   */
  Page<SalesWithdrawItemVo> completedPage(
    @Param("page") Page page,
    @Param("search") SalesWithdrawSearchParamPo search
  );
  Date completedLastUpdateTime(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  /**
   * 已作废
   */
  List<SalesWithdrawItemVo> obsolete(
    @Param("search") SalesWithdrawSearchParamPo search
  );

  /**
   * 获取已作废编号列表
   */
  List<Long> obsoleteIds(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 获取已作废的总数
   */
  Long obsoleteCount(@Param("search") SalesWithdrawSearchParamPo search);

  /**
   * 已作废分页
   */
  Page<SalesWithdrawItemVo> obsoletePage(
    @Param("page") Page page,
    @Param("search") SalesWithdrawSearchParamPo search
  );
  Date obsoleteLastUpdateTime(
    @Param("search") SalesWithdrawSearchParamPo search
  );
  /**
   * 更新状态为2
   */
  void updateSalesWithdrawStatus();
  /**
   * 关联单据(入库单)
   */
  void getStockInByRamNo();
  /**
   * 根据id获取主子表信息
   */
  void getSalesWithdrawOrdersById();
}
